/**
 *Copyright (c) 2003, 2018, UMF and/or its affiliates. All rights reserved.
 */
package com.umf.b2b.model.order;

import com.umf.b2b.MerchantBaseRequest;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.util.UMFUtil;

import java.util.List;

/**
<p>Title:ConsumeOrderQuery</p>  
<p>Description: ���׶�����ѯ</p>
 */
public class ConsumeOrderQuery extends MerchantBaseRequest {

	private String notify_url;
	private String mer_date;//����ѡ�[��Ӧ����] �̻��������ڣ��̻�ƽ̨���ɶ��������ڣ�YYYYMMDD
	private String order_id;//����ѡ�[��Ӧ����]���̻�ƽ̨�Լ����ɵĶ�����ţ���ʶ�ñʽ��׵�Ψһ��ţ�ÿ������ı�ű��벻һ����֧�����֡�Ӣ����ĸ���ʹ��
	private String trade_no;//����ѡ�[��Ӧ����],����������ţ���������������ƽ̨���صĶ�����
	private String url = "/consume/orderQuery";
	
	private String create_time;//[��Ӧ����]��������ʱ��HHMMSS
	private String amount;//[��Ӧ����]֧������������ң���λΪ��
	private String order_type;//[��Ӧ����]���Ѷ������Ͷ������ͣ�1������2������ 3����׼
	private String order_state;//[��Ӧ����]����״̬0-��ʼ1-֧����2-֧��ʧ��3-������4-���5-���˷�
	private PayInfo pay_info;//[��Ӧ����]֧����Ϣ
	private List<SplitInfo> split_info;//[��Ӧ����]������Ϣ
	private RefundInfo refund_info;//[��Ӧ����]�˿���Ϣ
	
	@Override
	public String getRequestUrl() {
		return baseUrl + url;
	}

	@Override
	public ConsumeOrderQuery doRequest() throws Exception {
		Message<ConsumeOrderQuery> response = UMFUtil.post(createAPIContext(), this,ConsumeOrderQuery.class);
		MerchantBaseRequest baseResult = convertResult(response, ConsumeOrderQuery.class);
		if(baseResult == null)
			return null;
		return (ConsumeOrderQuery)baseResult;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getOrder_id() {
		return order_id;
	}

	public void setOrder_id(String order_id) {
		this.order_id = order_id;
	}

	public String getMer_date() {
		return mer_date;
	}

	public void setMer_date(String mer_date) {
		this.mer_date = mer_date;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getTrade_no() {
		return trade_no;
	}

	public void setTrade_no(String trade_no) {
		this.trade_no = trade_no;
	}


	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getOrder_type() {
		return order_type;
	}

	public void setOrder_type(String order_type) {
		this.order_type = order_type;
	}

	public String getCreate_time() {
		return create_time;
	}

	public void setCreate_time(String create_time) {
		this.create_time = create_time;
	}

	public String getOrder_state() {
		return order_state;
	}

	public void setOrder_state(String order_state) {
		this.order_state = order_state;
	}

	public List<SplitInfo> getSplit_info() {
		return split_info;
	}

	public void setSplit_info(List<SplitInfo> split_info) {
		this.split_info = split_info;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ConsumeOrderQuery [notify_url=");
		builder.append(notify_url);
		builder.append(", mer_date=");
		builder.append(mer_date);
		builder.append(", order_id=");
		builder.append(order_id);
		builder.append(", trade_no=");
		builder.append(trade_no);
		builder.append(", url=");
		builder.append(url);
		builder.append(", create_time=");
		builder.append(create_time);
		builder.append(", amount=");
		builder.append(amount);
		builder.append(", order_type=");
		builder.append(order_type);
		builder.append(", order_state=");
		builder.append(order_state);
		builder.append(", pay_info=");
		builder.append(pay_info);
		builder.append(", split_info=");
		builder.append(split_info);
		builder.append(", refund_info=");
		builder.append(refund_info);
		builder.append(", version=");
		builder.append(version);
		builder.append(", mer_id=");
		builder.append(mer_id);
		builder.append(", ret_code=");
		builder.append(ret_code);
		builder.append(", ret_msg=");
		builder.append(ret_msg);
		builder.append(", links=");
		builder.append(links);
		builder.append("]");
		return builder.toString();
	}

	public PayInfo getPay_info() {
		return pay_info;
	}

	public void setPay_info(PayInfo pay_info) {
		this.pay_info = pay_info;
	}

	public RefundInfo getRefund_info() {
		return refund_info;
	}

	public void setRefund_info(RefundInfo refund_info) {
		this.refund_info = refund_info;
	}
}
